﻿<Window x:Class="PingTestWpfApplication.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Ping" Height="350" Width="525">
    <DockPanel Width="Auto" Height="Auto" LastChildFill="True">
        <StackPanel Width="Auto" Height="31" Background="#FFCAC5C5"
            Orientation="Horizontal" DockPanel.Dock="Bottom">

            <Label Width="155" Height="23" Content="Status Bar Message...."
            FontFamily="Arial" FontSize="10" Name="StatusMessage"/>
        </StackPanel>
        <StackPanel Width="100" Height="Auto" Background="White">
            <Button Margin="5,5,5,5" Width="Auto" Height="26" Content="Add New" Click="Button_Click" />
            <Button Margin="5,5,5,5" Width="Auto" Height="26" Content="Start" Name="Start"  Click="Start_Click" />
            <Button Margin="5,5,5,5" Width="Auto" Height="26" Content="Stop" Name="Stop" Click="Stop_Click" Visibility="Collapsed" />
            <Button Margin="5,5,5,5" Width="Auto" Height="26" Content="Refresh" Name="Refresh" Click="Refresh_Click" />
        </StackPanel>
        <Grid Width="Auto" Height="Auto">
            <Grid.DataContext>
                <XmlDataProvider Source="/Sites.xml" XPath="Root/Site" x:Name="XmlSource" />
            </Grid.DataContext>
            <Grid.Resources>
                <DataTemplate DataType="Site">
                        <Border Background="{Binding XPath=@Colour}" Margin="2,4,2,4" Padding="10" BorderThickness="1" BorderBrush="Black" CornerRadius="8" MouseDown="DoubleClickToEdit">
                            <Canvas Height="20">
                                <TextBlock Text="{Binding XPath=@Url}" Foreground="Black" FontSize="9" Name="Url" />
                                <Button Name="Remove" Click="Remove_Click" Content="x" Canvas.Right="0" >
                                </Button>
                        </Canvas>
                        </Border>
                </DataTemplate>
            </Grid.Resources>
            <ListBox Grid.Row="0" IsSynchronizedWithCurrentItem="True"
                 ItemsSource="{Binding}" Name="ListOfSites">
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                    </Style>
                </ListBox.ItemContainerStyle>
            </ListBox>
        </Grid>
    </DockPanel>

</Window>
